home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the 3D Game Programming Gurus / gurus.iso / DirectX / dx9sdkcp.exe / SDK (C++) / Bin / DXUtils / Visual Studio 6.0 Wizards / Source Code / Template / netvoice.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-11-12  |  2.6 KB  |  66 lines

  1. //-----------------------------------------------------------------------------
  2. // File: NetVoice.h
  3. //
  4. // Desc: 
  5. //-----------------------------------------------------------------------------
  6. #ifndef NETVOICE_H
  7. #define NETVOICE_H
  8.  
  9.  
  10. #include <windows.h>
  11. #include <dvoice.h>
  12.  
  13.  
  14. class CNetVoice
  15. {
  16. public:
  17.     CNetVoice( LPDVMESSAGEHANDLER pfnDirectPlayClientVoiceMessageHandler,
  18.                LPDVMESSAGEHANDLER pfnDirectPlayServerVoiceMessageHandler );
  19.     virtual ~CNetVoice();
  20.  
  21.     HRESULT Init( HWND hDlg, BOOL bCreateSession, BOOL bConnectToSession, 
  22.                   LPUNKNOWN pDirectPlay, DWORD dwSessionType, GUID* pGuidCT, 
  23.                   DVCLIENTCONFIG* pdvClientConfig, LPDIRECTSOUND lpds = NULL );
  24.     HRESULT Free();
  25.  
  26.     HRESULT HostMigrate( LPDIRECTPLAYVOICESERVER pdvServerInterface );
  27.     bool    IsHalfDuplex() { return m_bHalfDuplex; }
  28.     HRESULT ChangeVoiceClientSettings( DVCLIENTCONFIG* pdvClientConfig );
  29.  
  30.     LPDIRECTPLAYVOICECLIENT GetVoiceClient() { return m_pVoiceClient; }
  31.     LPDIRECTPLAYVOICESERVER GetVoiceServer() { return m_pVoiceServer; }
  32.  
  33.     HRESULT DoVoiceSetupDialog( HINSTANCE hInst, HWND hWndParent, GUID* pguidDVSessionCT, DVCLIENTCONFIG* pdvClientConfig );
  34.  
  35. protected:  
  36.     LPDIRECTPLAYVOICECLIENT m_pVoiceClient;
  37.     LPDIRECTPLAYVOICESERVER m_pVoiceServer;                                                                             
  38.     LPDVMESSAGEHANDLER m_pfnDirectPlayClientVoiceMessageHandler;
  39.     LPDVMESSAGEHANDLER m_pfnDirectPlayServerVoiceMessageHandler;
  40.  
  41.     HRESULT VoiceSessionCreate( LPUNKNOWN pDirectPlay, DWORD dwSessionType, GUID* pGuidCT );
  42.     HRESULT VoiceSessionTestAudioSetup( HWND hDlg );
  43.     HRESULT VoiceSessionConnect( HWND hDlg, LPUNKNOWN pDirectPlay, 
  44.                                  DVCLIENTCONFIG* pdvClientConfig, LPDIRECTSOUND lpds = NULL );
  45.     HRESULT VoiceSessionDisconnect();
  46.     HRESULT VoiceSessionDestroy();
  47.  
  48.     bool    m_bHalfDuplex;
  49.  
  50.     // Voice settings dialog vars and functions
  51.     BOOL    m_bVoiceSessionInProgress;   // True if voice has been init'ed
  52.     DVCLIENTCONFIG m_dvClientConfig;     // Voice client config
  53.     GUID    m_guidDVSessionCT;           // GUID for chosen voice compression
  54.     BOOL    m_bHostPlayer;               // TRUE if host player
  55.  
  56.     INT_PTR CALLBACK VoiceConfigDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam );
  57.     static INT_PTR CALLBACK StaticVoiceConfigDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam );
  58.  
  59.     HRESULT VoiceConfigEnumCompressionCodecs( HWND hDlg );
  60.     VOID    VoiceConfigDlgOnOK( HWND hDlg );
  61. };
  62.  
  63.  
  64. #endif // NETVOICE_H
  65.  
  66.